/**
 * tigerrad
 * fall 2006
 */

#ifndef _FLOATTEXTURE_H
#define _FLOATTEXTURE_H

#include "Texture.h"
#include "Program.h"

/**
 * Floating point (32 bit per component) non-POT texture.
 * TODO allow 1-4 components
 */
class FloatTexture : public Texture
{
	public:
		/**
		 * Constructor.  Will create an empty texture.
		 * TODO allow parameter customization?
		 * @param name Debug name (id).
		 * @param s Size of the texture.  Does not need to be POT.
		 */
		FloatTexture(const std::string& name, const Vec2s& s);

		/**
		 * From texture.
		 */
		virtual void drawFullScreen();
		void drawFullScreen_begin();
		void drawFullScreen_end();

		/**
		 * From Texture...
		 */
		virtual void readPixels();
		
		/**
		 * From Texture...
		 */
		virtual Vec4 getPixel(Vec2s at);

		/**
		 * Destructor.
		 */
		~FloatTexture();
		
	private:
		/**
		 * For drawFullScreen, need GLSL program.  This will
		 * be shared between all FloatTexture instances.
		 */
		static void createQuadProgram();

		static ProgramPtr _quadProg;


		GLfloat* _pixels;

		
};

#endif

